<html>
<head><meta charset="utf-8"><title>Thank you for exported names in errors! · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html">Thank you for exported names in errors!</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="227075145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/227075145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#227075145">(Feb 20 2021 at 07:56)</a>:</h4>
<p>I rebased to master today and was pleasantly surprised to see that my ui test output needed to be updated because it's showing the trait under its publicly-exposed name.  Thanks to everyone who got that working!</p>



<a name="227139240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/227139240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#227139240">(Feb 21 2021 at 03:54)</a>:</h4>
<p>What do the new errors look like?</p>



<a name="227155767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/227155767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#227155767">(Feb 21 2021 at 09:29)</a>:</h4>
<p>See <a href="https://github.com/rust-lang/rust/pull/82318/commits/a6637b6066452c734b93d6a9267c7dd52419765a">https://github.com/rust-lang/rust/pull/82318/commits/a6637b6066452c734b93d6a9267c7dd52419765a</a> for some examples</p>
<p>For bootstrapping reasons I have the trait defined as <code>Try2021</code>, but it's exported as just <code>Try</code>, and now the errors mention <code>Try</code> instead of <code>Try2021</code>, which is really nice.  There's also a bunch of places that used to write out <code> for `std::result::Result&lt;i32, ()&gt;` </code> but now just say <code> for `Result&lt;i32, ()&gt;` </code>.</p>



<a name="227186844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/227186844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#227186844">(Feb 21 2021 at 18:58)</a>:</h4>
<p>Oh, is that turned on by default now?</p>



<a name="227186852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/227186852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#227186852">(Feb 21 2021 at 18:58)</a>:</h4>
<p>nice</p>



<a name="227190185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/227190185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#227190185">(Feb 21 2021 at 19:57)</a>:</h4>
<p>Well it's on in the UI tests at least <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="227193278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/227193278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Henry-Mantilla <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#227193278">(Feb 21 2021 at 20:52)</a>:</h4>
<p>Does that work for type aliases too? I was thinking of things like being able to define a <code>repr_c::Box&lt;T&gt;</code> as well as a <code>repr_c::Box&lt;[T]&gt;</code>, while keeing internally a special implementation for the slice case (<code>c_slice::Box&lt;T&gt;</code>) and it recently occured to me that I could export a type alias using a helper trait so that<br>
<code>both::Box&lt;T&gt;</code> unifies both things under a common name; but the (minor) "issue" is that in error messages and such the actual type names / paths do leak <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="227194045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/227194045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#227194045">(Feb 21 2021 at 21:07)</a>:</h4>
<p>Oh wow, that is nice!</p>



<a name="227194143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/227194143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#227194143">(Feb 21 2021 at 21:08)</a>:</h4>
<p>And these errors changed too!</p>
<h1>stable</h1>
<div class="codehilite"><pre><span></span><code>error[E0308]: mismatched types
 --&gt; src/lib.rs:2:5
  |
2 |     Ok(1)
  |     ^^^^^ expected `()`, found enum `std::result::Result`
  |
  = note: expected unit type `()`
                  found enum `std::result::Result&lt;{integer}, _&gt;`
help: try adding a semicolon
  |
2 |     Ok(1);
  |          ^
help: try adding a return type
  |
1 | fn foo() -&gt; std::result::Result&lt;{integer}, _&gt; {
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
</code></pre></div>
<h1>nightly</h1>
<div class="codehilite"><pre><span></span><code>error[E0308]: mismatched types
 --&gt; src/lib.rs:2:5
  |
2 |     Ok(1)
  |     ^^^^^ expected `()`, found enum `Result`
  |
  = note: expected unit type `()`
                  found enum `Result&lt;{integer}, _&gt;`
help: try adding a semicolon
  |
2 |     Ok(1);
  |          ^
help: try adding a return type
  |
1 | fn foo() -&gt; Result&lt;{integer}, _&gt; {
  |          ^^^^^^^^^^^^^^^^^^^^^^^
</code></pre></div>
<p>That has always bothered me, so it's amazing that someone got it working better! <span aria-label="love" class="emoji emoji-2764" role="img" title="love">:love:</span></p>



<a name="227194373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/227194373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#227194373">(Feb 21 2021 at 21:13)</a>:</h4>
<p>Looks like it might have been implemented in <a href="https://github.com/rust-lang/rust/issues/73996">#73996</a>, so thank you to <code>@da-x</code>!</p>



<a name="227194671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/227194671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#227194671">(Feb 21 2021 at 21:18)</a>:</h4>
<p>Or for the <code>Result</code> case I think it was <a href="https://github.com/rust-lang/rust/issues/78052">#78052</a>.</p>



<a name="228466379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Thank%20you%20for%20exported%20names%20in%20errors%21/near/228466379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Thank.20you.20for.20exported.20names.20in.20errors!.html#228466379">(Mar 02 2021 at 19:03)</a>:</h4>
<p>This does not work with Clippy?<br>
<a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=bc660c25c15422e5df85cf12a7a719f1">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=bc660c25c15422e5df85cf12a7a719f1</a></p>
<h1>stable</h1>
<div class="codehilite"><pre><span></span><code>error[E0308]: mismatched types
 --&gt; src/main.rs:2:5
  |
1 | fn main() {
  |           - expected `()` because of default return type
2 |     Ok(1)
  |     ^^^^^- help: try adding a semicolon: `;`
  |     |
  |     expected `()`, found enum `std::result::Result`
  |
  = note: expected unit type `()`
                  found enum `std::result::Result&lt;{integer}, _&gt;`
</code></pre></div>
<h1>nightly</h1>
<div class="codehilite"><pre><span></span><code>error[E0308]: mismatched types
 --&gt; src/main.rs:2:5
  |
1 | fn main() {
  |           - expected `()` because of default return type
2 |     Ok(1)
  |     ^^^^^ expected `()`, found enum `Result`
  |
  = note: expected unit type `()`
                  found enum `Result&lt;{integer}, _&gt;`
</code></pre></div>
<h1>clippy</h1>
<div class="codehilite"><pre><span></span><code>error[E0308]: mismatched types
 --&gt; src/main.rs:2:5
  |
1 | fn main() {
  |           - expected `()` because of default return type
2 |     Ok(1)
  |     ^^^^^ expected `()`, found enum `std::result::Result`
  |
  = note: expected unit type `()`
                  found enum `std::result::Result&lt;{integer}, _&gt;`
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>